<!DOCTYPE html>
<html lang="en">
<head>
    <!--<meta charset="UTF-8">-->
    <title>Title</title>
    <script>
        function fun(){
            var arr1 = ["anna","jjdhj","hsdifh"];
            var arr2 = new Array("ddad","ss","sss6");
            var arr3 = arr1.concat(arr2);
            var p = document.getElementById("p1").innerHTML = arr3;

        }
        var arr1 = ["anna","jjdhj","hsdifh"];
        function add(){
            arr1.push("new array");
            document.getElementById("p2").innerHTML = arr1;
            console.log(arr1);
        }
    </script>
</head>
<body>
<p>这是一个合并数组的例子</p>>
<button type="button" onclick="fun()">concat()</button>
<p id="p2"> </p>
<button type="button" onclick="add()">push()</button>
<p id="p1"> </p>
</body>
</html>